<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    
    <title>PCA降维的数学理解与举例 | ATOM 阿瞳目 | 欲穷千里目，更上一层楼</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="机器学习,降维">
    <meta name="description" content="PCA(Principle Component Analysis 主成分分析)是深度学习中最常用的降维算法。本文将通过最基础的线性代数知识对PCA算法进行解释。  0. 为什么要进行降维&amp;降维的目标&amp;降维的原则0.1 为什么要进行降维在深度学习中，需要对大量的样本数据进行处理，而每个样本会包含很多特征（即维度），这样在进行各种运算和训练时无疑会消耗大量的内存和时间，所以我们希望适">
<meta property="og:type" content="article">
<meta property="og:title" content="PCA降维的数学理解与举例">
<meta property="og:url" content="https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/index.html">
<meta property="og:site_name" content="ATOM 阿瞳目">
<meta property="og:description" content="PCA(Principle Component Analysis 主成分分析)是深度学习中最常用的降维算法。本文将通过最基础的线性代数知识对PCA算法进行解释。  0. 为什么要进行降维&amp;降维的目标&amp;降维的原则0.1 为什么要进行降维在深度学习中，需要对大量的样本数据进行处理，而每个样本会包含很多特征（即维度），这样在进行各种运算和训练时无疑会消耗大量的内存和时间，所以我们希望适">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-02-16T15:58:39.000Z">
<meta property="article:modified_time" content="2020-05-28T01:23:37.331Z">
<meta property="article:author" content="Richard Yann">
<meta property="article:tag" content="机器学习">
<meta property="article:tag" content="降维">
<meta name="twitter:card" content="summary">
    
        <link rel="alternate" type="application/atom+xml" title="ATOM 阿瞳目" href="/atom.xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="/css/style.css?v=1.7.2">
    <script>window.lazyScripts=[]</script>

	<link rel="stylesheet" href="/css/_partial/prism.css?v=1.7.2">
	
    <!-- custom head -->
    

<meta name="generator" content="Hexo 4.2.1"></head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">Richard Yann</h5>
          <a href="mailto:yanrichard500@gmail.com" title="yanrichard500@gmail.com" class="mail">yanrichard500@gmail.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                归档
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                分类
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://blog.csdn.net/weixin_42062018" target="_blank" rel="noopener"  >
                <i class="icon icon-lg icon-link"></i>
                CSDN
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/RichardYann" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">PCA降维的数学理解与举例</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">PCA降维的数学理解与举例</h1>
        <h5 class="subtitle">
            
                <time datetime="2020-02-16T15:58:39.000Z" itemprop="datePublished" class="page-time">
  2020-02-16
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a></li></ul>

            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap post-toc-shrink" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#0-为什么要进行降维-amp-降维的目标-amp-降维的原则"><span class="post-toc-text">0. 为什么要进行降维&amp;降维的目标&amp;降维的原则</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#0-1-为什么要进行降维"><span class="post-toc-text">0.1 为什么要进行降维</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#0-2-降维的目标"><span class="post-toc-text">0.2 降维的目标</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#0-3-降维的原则"><span class="post-toc-text">0.3 降维的原则</span></a></li></ol></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#1-计算X，Y的协方差矩阵"><span class="post-toc-text">1. 计算X，Y的协方差矩阵</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#2-对角化"><span class="post-toc-text">2. 对角化</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#3-降维"><span class="post-toc-text">3. 降维</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#4-举例"><span class="post-toc-text">4. 举例</span></a></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#在使用PCA时注意："><span class="post-toc-text">在使用PCA时注意：</span></a></li></ol>
        </nav>
    </aside>


<article id="post-PCA降维的数学理解与举例"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">PCA降维的数学理解与举例</h1>
        <div class="post-meta">
            <time class="post-time" title="2020-02-16 23:58:39" datetime="2020-02-16T15:58:39.000Z"  itemprop="datePublished">2020-02-16</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a></li></ul>



            

        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <blockquote>
<p>PCA(Principle Component Analysis 主成分分析)是深度学习中最常用的降维算法。本文将通过最基础的线性代数知识对PCA算法进行解释。</p>
</blockquote>
<h4 id="0-为什么要进行降维-amp-降维的目标-amp-降维的原则"><a href="#0-为什么要进行降维-amp-降维的目标-amp-降维的原则" class="headerlink" title="0. 为什么要进行降维&amp;降维的目标&amp;降维的原则"></a>0. 为什么要进行降维&amp;降维的目标&amp;降维的原则</h4><h5 id="0-1-为什么要进行降维"><a href="#0-1-为什么要进行降维" class="headerlink" title="0.1 为什么要进行降维"></a>0.1 为什么要进行降维</h5><p>在深度学习中，需要对大量的样本数据进行处理，而每个样本会包含很多特征（即维度），这样在进行各种运算和训练时无疑会消耗大量的内存和时间，所以我们希望适当的减少每个样本的维度，从而简化运算。</p>
<h5 id="0-2-降维的目标"><a href="#0-2-降维的目标" class="headerlink" title="0.2 降维的目标"></a>0.2 降维的目标</h5><p>假设原始的数据集为$X_{m×n}$，如下所示：<br>$$X_{m×n}=\left[<br>\begin{matrix}<br>x_1^{(1)}&amp;x_2^{(1)}&amp;\dots &amp; x_n^{(1)} \\ x_1^{(2)}&amp;x_2^{(2)}&amp;\dots &amp; x_n^{(2)} \\ \vdots&amp;\vdots&amp;\ddots&amp;\vdots \\ x_1^{(m)}&amp; x_2^{(m)}&amp;\dots &amp; x_n^{(m)}<br>\end{matrix}<br>\right]$$<br>表示有m个样本数据，每个样本数据有n个维度。即上述矩阵每一行是一个样本，共m个样本；每一列是一个维度，共n个维度。</p>
<p>我们的目标是不改变样本数量，减少样本维度，即减少上述矩阵的列数。</p>
<p>假设降成k维，则最终得到的降维后数据集为：<br>$$Y_{m×k}=\left[<br>\begin{matrix}<br>y_1^{(1)}&amp;y_2^{(1)}&amp;\dots &amp; y_k^{(1)}\\ y_1^{(2)}&amp;y_2^{(2)}&amp;\dots &amp; y_k^{(2)}\\ \vdots&amp;\vdots&amp;\ddots&amp;\vdots\\ y_1^{(m)}&amp;y_2^{(m)}&amp;\dots &amp; y_k^{(m)}<br>\end{matrix}<br>\right]$$</p>
<p>设$Y_{m×k}=X_{m×n}Q_{n×k}$，<strong>我们只要求出Q，就可以把X降维成Y，因此我们的目标就是找出一个恰当的Q</strong></p>
<h5 id="0-3-降维的原则"><a href="#0-3-降维的原则" class="headerlink" title="0.3 降维的原则"></a>0.3 降维的原则</h5><p>我们要在降低维度时尽可能减少数据的损失，所以我们让<strong>不同维度之间尽可能接近，同一维度的不同数据尽可能分散</strong>。（不同维度之间越接近，就意味着去掉一些维度时损失较小；同一维度的不同数据越分散，就意味着在这一维度上的数据越容易被区分）</p>
<p>我们在协方差矩阵中来衡量这一接近、分散程度。</p>
<blockquote>
<p>以m个3维数据为例：（<em>注意：a,b,c 表示不同维度，每一行是一个样本，每一列是一个维度</em>）<br>$$\left[\begin{matrix}<br>a_1&amp;b_1&amp;c_1\\ a_2&amp;b_2&amp;c_2\\ \vdots&amp;\vdots&amp;\vdots\\ a_m&amp;b_m&amp;c_m<br>\end{matrix}\right]$$<br>其协方差为：<br>$$cov=\left[\begin{matrix}<br>cov(a,a)&amp;cov(a,b)&amp;cov(a,c)\\ cov(b,a)&amp;cov(b,b)&amp;cov(b,c)\\ cov(c,a)&amp;cov(c,b)&amp;cov(c,c)<br>\end{matrix}\right]$$<br>容易看出在协方差矩阵中，对角线元素表示的是每个维度上样本的方差，而非对角线元素表示的是不同维度之间样本的协方差。要使得“不同维度之间尽可能接近，同一维度数据尽可能分散”，就要让<strong>非对角线元素尽可能小，对角线元素尽可能大</strong>。</p>
</blockquote>
<p>我们通过对数据的处理，使其协方差矩阵成为一个对角阵，那么非对角线元素为0，我们就可以放心的删去多余的维度；在删去时，我们删掉较小的对角线元素对应的列。</p>
<h4 id="1-计算X，Y的协方差矩阵"><a href="#1-计算X，Y的协方差矩阵" class="headerlink" title="1. 计算X，Y的协方差矩阵"></a>1. 计算X，Y的协方差矩阵</h4><p>对于原始数据集$X_{m×n}$，其协方差矩阵为：<br>$$Cx_{n×n}=\frac{1}{m}X^TX$$（概率论里除以m-1的公式是无偏估计，但是这里数据总数已知，不涉及估计问题，只涉及离散程度的描述，因此除以m）</p>
<p>我们设最终数据集$Y_{m×k}=X_{m×n}Q_{n×k}$，则其协方差矩阵满足：<br>$$Cy_{k×k}=\frac{1}{m}Y^TY \\ =\frac{1}{m}Q^TX^TXQ \\ =Q^TCxQ$$</p>
<h4 id="2-对角化"><a href="#2-对角化" class="headerlink" title="2. 对角化"></a>2. 对角化</h4><p>在降维之前，我们要处理数据集使其协方差矩阵成为对角阵，（即数据集要经过两步处理，X→ Y’ →Y），设 $Y’_{m×n}=X_{m×n}Q’_{n×n}$<br>则同理可得 $Y’$ 的协方差矩阵为：  </p>
<p>$$Cy’_{k×k} = \frac{1}{m}Y’^TY’ \\ =\frac{1}{m}Q’^TX^TXQ’ \\ =Q’^TCxQ’$$</p>
<p>对 $Cx$，有 $Cx=P\Lambda P^{T}$</p>
<blockquote>
<p>设$Cx$特征值为：$\lambda_1, \lambda_2, \dots, \lambda_n$（$\lambda_1 ≥\lambda_2≥\dots≥\lambda_n$）<br>对应特征向量为：$\xi_1, \xi_2, \dots, \xi_n$<br>则令$P=[\xi_1,\xi_2,\dots, \xi_n]$，有$Cx=P\Lambda P^{-1}$<br>其中，$\Lambda=diag[\lambda_1, \lambda_2, \dots, \lambda_n]$，是一个由特征值构成的对角阵<br>由于协方差矩阵一定是对称阵，根据对称阵的性质，不同特征值对应的特征向量正交，即$P^TP=I=P^{-1}P$，即$P^T=P^{-1}$<br>故有$Cx=P\Lambda P^T$</p>
</blockquote>
<p>因此我们令$Q’=P$，则有：<br>$$Cy’=Q’^TCxQ’ \\ =P^TP\Lambda P^TP \\ =\Lambda=diag[\lambda_1 \lambda_2 \dots \lambda_n]$$</p>
<p>这样我们就将协方差矩阵转成了对角阵，实现这一变化的矩阵$Q’=P$。</p>
<h4 id="3-降维"><a href="#3-降维" class="headerlink" title="3. 降维"></a>3. 降维</h4><p>假设降低成k维，由于之前已经将特征值从大到小排序，所以取前k个特征值$\lambda$对应的特征向量$\xi$构成$Q$:<br>$$Q=[\xi_1,\xi_2,\dots,\xi_k]$$<br>这样得到最终数据集$Y$的协方差矩阵：<br>$$Cy=Q^TCxQ \\ =diag[\lambda_1 \dots \lambda_k] \\ (\lambda_i是n维列向量)$$<br>则$Y=XQ$，实现了从$X_{m×n}$到$Y_{m×k}$的降维。</p>
<h4 id="4-举例"><a href="#4-举例" class="headerlink" title="4. 举例"></a>4. 举例</h4><p>若给定原始数据集为<br>$$X=\left[\begin{matrix}<br>1&amp;-1&amp;3&amp;2&amp;0 \\ -2&amp;0&amp;4&amp;1&amp;1<br>\end{matrix}\right]$$<br>则其协方差矩阵为<br>$$Cx=\frac{1}{2}X^TX \\ =\left[\begin{matrix}<br>2.5&amp;-0.5&amp;-2.5&amp;0&amp;-1 \\ -0.5&amp;0.5&amp;-1.5&amp;-1&amp;0 \\ -2.5&amp;-1.5&amp;12.5&amp;5&amp;2 \\ 0&amp;-1&amp;5&amp;2.5&amp;0.5 \\ -1&amp;0&amp;2&amp;0.5&amp;0.5<br>\end{matrix}\right]$$<br>其特征值为：$\lambda_1=15.5,\lambda_2=3,\lambda_{3,4,5}≈0$<br>对应特征向量$\xi_1$~$\xi_5$构成矩阵$P$为：<br>$$P=[\begin{matrix}\xi_1&amp;\xi_2&amp;\xi_3&amp;\xi_4&amp;\xi_5]\end{matrix} \\ =\left[\begin{matrix}<br>-0.18&amp;-0.82&amp;-0.29&amp;0.38&amp;0.27 \\ -0.11&amp;0.33&amp;0.11&amp;0.90&amp;-0.23 \\ 0.90&amp; 0  &amp;-0.41&amp;0.15&amp;-0.05 \\ 0.36 &amp;  -0.41 &amp;  0.82  &amp; 0.04&amp; -0.18 \\ 0.14 &amp;   0.24 &amp;  0.25&amp;  0.13 &amp;   0.92<br>\end{matrix}\right]$$<br>观察特征值，我们很容易发现后面三个非常小接近0，故而可以忽略，所以我们把原来的5维降低成2维是合理的，那么我们只需取最大的两个特征值对应的特征向量来构成$Q$：<br>$$Q=[\begin{matrix}\xi_1&amp;\xi_2]\end{matrix} \\ =\left[\begin{matrix}<br>-0.18&amp;-0.82 \\ -0.11&amp;0.33 \\ 0.90&amp; 0 \\ 0.36 &amp;  -0.41 \\ 0.14 &amp;   0.24<br>\end{matrix}\right]$$<br>则得到降维后的数据集$Y:$<br>$$Y=XQ \\ =\left[\begin{matrix}<br>3.34&amp;-1.96 \\ 4.45&amp;1.47<br>\end{matrix}\right]$$</p>
<p>通常情况下，用PCA降维的同时还伴随着数据中心化，即使得所有数据点的中心归一到坐标原点。为与普遍的算法结果保持一致，我们对上述降维后的数据集进行中心化，即每一列减去该列的均值，得到：<br>$$Y_{中心化}=\left[\begin{matrix}<br>-0.56&amp;-1.71 \\ 0.56&amp;1.71<br>\end{matrix}\right]$$</p>
<blockquote>
<h4 id="在使用PCA时注意："><a href="#在使用PCA时注意：" class="headerlink" title="在使用PCA时注意："></a>在使用PCA时注意：</h4><ul>
<li>一定要弄清楚数据集的行、列，哪个是样本数，哪个是特征数（维度）</li>
<li>若数据集以行表示维度，列表示样本数（即与本文相反），那么协方差矩阵一定不能用自带的函数计算，其计算公式改为$Cx=\frac{1}{m}XX^T$, 其他的将相应的列操作变成行操作即可。不过与其如此，不如直接把原始数据集转置。</li>
</ul>
</blockquote>

        </div>

        <blockquote class="post-copyright">
    
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2020-05-28T01:23:37.331Z" itemprop="dateUpdated">2020-05-28 09:23:37</time>
</span><br>


        
        原创不易，转载请注明出处哦~
        
    </div>
    
    <footer>
        <a href="https://richardyann.gitee.io">
            <img src="/img/avatar.jpg" alt="Richard Yann">
            Richard Yann
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/" rel="tag">机器学习</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%99%8D%E7%BB%B4/" rel="tag">降维</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/&title=《PCA降维的数学理解与举例》 — ATOM 阿瞳目&pic=https://richardyann.gitee.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/&title=《PCA降维的数学理解与举例》 — ATOM 阿瞳目&source=欢迎光临~" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《PCA降维的数学理解与举例》 — ATOM 阿瞳目&url=https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/&via=https://richardyann.gitee.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2020/03/20/%E9%AB%98%E6%96%AF%E6%B7%B7%E5%90%88%E6%A8%A1%E5%9E%8BGMM%E8%81%9A%E7%B1%BB%E7%9A%84%E6%AD%A5%E9%AA%A4%E5%92%8C%E6%8E%A8%E5%AF%BC/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h5 class="title">高斯混合模型GMM聚类的步骤和推导</h5>
      </a>
    </div>
  

  
</nav>



    











    <!-- Valine Comments -->
    <div class="comments vcomment" id="comments"></div>
    <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
    <script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>
    <!-- Valine Comments script -->
    <script>
        var GUEST_INFO = ['nick','mail','link'];
        var guest_info = 'nick,mail,link'.split(',').filter(function(item){
          return GUEST_INFO.indexOf(item) > -1
        });
        new Valine({
            el: '#comments',
            notify: 'false' == 'true',
            verify: 'false' == 'true',
            appId: "M4yQMNFFRkn5MlX8nVut4Bns-gzGzoHsz",
            appKey: "2GXS36F9dMO6lib96qjPLtIr",
            avatar: "mm",
			visiter: "false",
            placeholder: "说点儿什么吗...",
            guest_info: guest_info.length == 0 ? GUEST_INFO : guest_info,
            pageSize: "10"
        })
    </script>
    <!-- Valine Comments end -->









</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        你这么好看，不会介意请我杯咖啡吧~
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="/img/wechat.jpg" alt="打赏二维码">
        </div>
        
        <label class="reward-toggle">
            <input id="rewardToggle" type="checkbox" class="reward-toggle-check"
                data-wechat="/img/wechat.jpg" data-alipay="/img/alipay.jpg">
            <div class="reward-toggle-ctrol">
                <span class="reward-toggle-item wechat">微信</span>
                <span class="reward-toggle-label"></span>
                <span class="reward-toggle-item alipay">支付宝</span>
            </div>
        </label>
        
    </div>
</div>



</div>

        <footer class="footer" style="position:fixed;bottom:0;width:100%">
<!--
    <div class="top">
        

        <p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循 <a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" target="_blank">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
-->
    <div class="bottom">
        <p><span>Richard Yann &copy; 2020 - 2021</span>
<!--
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
--!>
        </p>
    </div>
	
	<script src="/js/prism/prism.min.js?v=1.7.2" async></script>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/&title=《PCA降维的数学理解与举例》 — ATOM 阿瞳目&pic=https://richardyann.gitee.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/&title=《PCA降维的数学理解与举例》 — ATOM 阿瞳目&source=欢迎光临~" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《PCA降维的数学理解与举例》 — ATOM 阿瞳目&url=https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/&via=https://richardyann.gitee.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://richardyann.gitee.io/2020/02/16/PCA%E9%99%8D%E7%BB%B4%E7%9A%84%E6%95%B0%E5%AD%A6%E7%90%86%E8%A7%A3%E4%B8%8E%E4%B8%BE%E4%BE%8B/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


</script>

<script src="/js/main.min.js?v=1.7.2"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="/js/search.min.js?v=1.7.2" async></script>



<!-- mathjax config similar to math.stackexchange -->

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
		displayMath: [ ['$$','$$'] ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
});

MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';
    }
});
</script>

<script async src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML" async></script>






<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '别走~待会儿~嘛去~';
            clearTimeout(titleTime);
        } else {
            document.title = 'Welcome to ATOM！';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
<script type="text/javascript" src="//js.mfpad.com/mfsapi.js"></script>
</html>
